package bookStore.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;


import org.apache.commons.dbutils.QueryRunner;
/**
 * dao模板，包含dao常用变量
 * @author lian jie
 *
 */
public  class DaoTemplate{
	/**
	 * 数据库连接
	 */
	protected Connection connection;
	/**
	 * sql语句
	 */
	protected String sql;
	/**
	 * apache DbUtil中的QueryRunner，用来执行查询
	 */
	protected QueryRunner queryRunner=new QueryRunner();

	protected PreparedStatement pstat;
	
	protected ResultSet rs;
	
	public DaoTemplate(Connection connection) {
		super();
		this.connection = connection;
	}
	public Connection getConnection() {
		return connection;
	}
	public void setConnection(Connection connection) {
		this.connection = connection;
	}

	public String getSql() {
		return sql;
	}
	public void setSql(String sql) {
		this.sql = sql;
	}
	
	
}
